<%@page import="cn.com.entity.News"%>
<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<style type="text/css">
body{
color: #03C;
}
</style>
<script type="text/javascript">
function shanchu(){
		var queren=confirm("确认要删除吗");
		if(queren!=true){
			return false;
		}
}

</script>
</head>
<body>
<%if(session.getAttribute("manager")!=null){ %>
<center><h2>新闻管理</h2></center><br/>
<center>${newsmsg}</center>
<table align="center" width="80%" border="1">
	<tr>
		<td>新闻标题</td>
		<td>新闻内容</td>
		<td>发表时间</td>
		<td>修改</td>
		<td>删除</td>
	</tr>
<%
List<News> list=(List<News>)session.getAttribute("allnewslist");
if(list!=null){
	for(int i=0;i<list.size();i++){
		News news=list.get(i);
%>	
	<tr>
		<td><%=news.getNewstitle()%></td>
		<td><%=news.getNewscontent()%></td>
		<td><%=news.getNewspublishedtime()%></td>
		<td><a href="selectonenewsaction?news.newsid=<%=news.getNewsid()%>" target="_self">修改</a></td>
		<td><a href="deletenewsaciton?news.newsid=<%=news.getNewsid()%>" onclick="return shanchu()" >删除</a></td>
	</tr>
<%}
}%>	
</table>
<%} 
else{
	response.sendRedirect("managerlogin.jsp");	
}
%>
</body>
</html>